home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / ste / mega / wrap_fix.arc / TST_WRAP.S < prev    next >
Text File  |  1992-03-18  |  2KB  |  71 lines

  1. ; Program: TST_WRAP.S
  2. ;
  3. ; Author:  BKM
  4. ; Copyright (c) 1992, BKM, All Rights Reserved
  5. ;
  6. ; History:
  7. ;  It seemed to me that the best place to start in checking for
  8. ;   why the Monochrome screen would wrap in certain programs was
  9. ;   to determine what the programs that wrapped were doing.
  10. ;   The best program that I have found is MONST2 (Debugger).
  11. ;  I noticed that the screen would wrap when I used the 'V'
  12. ;   command.  This lead me to the idea that what was happening
  13. ;   was a problem with the program changing the physical and 
  14. ;   logical screen addresses.
  15. ;  It did not matter what you passed for the values to Physbase
  16. ;   or Logbase.  Only passing the resolution from a variable 
  17. ;   or as a constant mattered.  If I passed a -1, the program 
  18. ;   would not wrap.
  19. ;
  20. ;**************************************
  21. ; System equates...
  22. ;**************************************
  23. GEMDOS        equ    $01
  24. XBIOS        equ    $0e
  25.  
  26. ; GEMDOS functions...
  27. SetBlock    equ    $4a
  28. Pterm        equ    $4c
  29.  
  30. ; XBIOS functions...
  31. Setscreen    equ    $05
  32. Supexec        equ    $38
  33. ;**************************************
  34.     text
  35. _Start:
  36.         move.l    $04(sp),a3        ; Basepage
  37.         move.l    $0c(a3),d0        ; TEXT length
  38.         add.l    $14(a3),d0        ; DATA length
  39.         add.l    $1c(a3),d0        ; BSS length
  40.         add.l    #$100,d0        ; stack size
  41.         move.l    #Mystack,sp        ; Use it
  42.         move.l    d0,-(sp)        ; Shrink memory
  43.         clr.w    -(sp)
  44.         move.w    #SetBlock,-(sp)
  45.         trap    #GEMDOS
  46.         add.l    #12,sp
  47. _Get_Res:
  48.         move.w    #4,-(sp)        ; Get resolution
  49.         trap    #XBIOS            ; and save it.
  50.         addq.l    #2,sp
  51.         move.w    d0,Res
  52. _Set_Res:
  53.         move.w    Res,-(sp)        ; Setscreen
  54.         move.l    #-1,-(sp)        ; using original values
  55.         move.l    #-1,-(sp)
  56.         move.w    #Setscreen,-(sp)
  57.         trap    #XBIOS
  58.         add.l    #12,sp
  59. _Exit:
  60.         clr.w    -(sp)            ; No return code
  61.         move.w    #Pterm,-(sp)        ; Exit not resident
  62.         trap    #GEMDOS
  63.         illegal                ; If it ever gets here
  64.                         ; we're in big trouble!!!
  65.  
  66.         even
  67.         bss
  68. Res        ds.w    1            ; Hold Current Resolution
  69.         ds.l    100            ; Space for stack goes here
  70. Mystack        ds.l    0
  71.